package hos.location;

import java.util.EventObject;


/**
 * <p>Title: LocationEvent </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2023/9/23 13:41
 */
public class LocationEvent extends EventObject {
    private final LocationSource mSource;

    public LocationEvent(LocationSource source) {
        super(source);
        this.mSource = source;
    }

    public LocationSource getSource() {
        return this.mSource;
    }

    public static final class LocationChangedEvent extends LocationEvent {
        private final LocationData mLocation;

        public LocationChangedEvent(LocationSource source, LocationData location) {
            super(source);
            this.mLocation = location;
        }

        public LocationData getLocation() {
            return this.mLocation;
        }
    }

    public static final class HeadingChangedEvent extends LocationEvent {
        private final double mHeading;

        public HeadingChangedEvent(LocationSource source, double heading) {
            super(source);
            this.mHeading = heading;
        }

        public double getHeading() {
            return this.mHeading;
        }
    }

    public static final class StatusChangedEvent extends LocationEvent {
        private final LocationSource.Status mStatus;

        public StatusChangedEvent(LocationSource source, LocationSource.Status status) {
            super(source);
            this.mStatus = status;
        }


        public LocationSource.Status getStatus() {
            return this.mStatus;
        }
    }
}
